* (bug 18242) Show the Subversion revision number per extensions in Special:Version...
authorShinjiman <shinjiman@users.mediawiki.org>
Sun, 26 Apr 2009 05:22:33 +0000 (05:22 +0000)
committerShinjiman <shinjiman@users.mediawiki.org>
Sun, 26 Apr 2009 05:22:33 +0000 (05:22 +0000)
RELEASE-NOTES
includes/specials/SpecialVersion.php
languages/messages/MessagesEn.php
languages/messages/MessagesLzh.php
languages/messages/MessagesYue.php
languages/messages/MessagesZh_hans.php
languages/messages/MessagesZh_hant.php
maintenance/language/messages.inc

index 6aa42bf..325e445 100644 (file)
@@ -177,6 +177,8 @@ The following extensions are migrated into MediaWiki 1.15:
 * Added $wgExtPGAlteredFields to allow extensions to easily alter the data 
   type of columns when using the Postgres backend.
 * (bug 16950) Show move log when viewing/creating a deleted page
+* (bug 18242) Show the Subversion revision number per extensions in 
+  Special:Version
 
 
 === Bug fixes in 1.15 ===
index 9a79561..60db8d5 100644 (file)
@@ -114,7 +114,7 @@ class SpecialVersion extends SpecialPage {
        public static function getVersion() {
                global $wgVersion, $IP;
                wfProfileIn( __METHOD__ );
-               $svn = self::getSvnRevision( $IP );
+               $svn = self::getSvnRevision( $IP, false );
                $version = $svn ? "$wgVersion (r$svn)" : $wgVersion;
                wfProfileOut( __METHOD__ );
                return $version;
@@ -129,7 +129,7 @@ class SpecialVersion extends SpecialPage {
        public static function getVersionLinked() {
                global $wgVersion, $IP;
                wfProfileIn( __METHOD__ );
-               $svn = self::getSvnRevision( $IP );
+               $svn = self::getSvnRevision( $IP, false );
                $viewvc = 'http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/?pathrev=';
                $version = $svn ? "$wgVersion ([{$viewvc}{$svn} r$svn])" : $wgVersion;
                wfProfileOut( __METHOD__ );
@@ -163,7 +163,9 @@ class SpecialVersion extends SpecialPage {
 
                                foreach ( $wgExtensionCredits[$type] as $extension ) {
                                        $version = null;
-                                       $subVersion = '';
+                                       $subVersion = null;
+                                       if (isset($extension['path']))
+                                               $subVersion = self::getSvnRevision(dirname($extension['path']), true);
                                        if ( isset( $extension['version'] ) ) {
                                                $version = $extension['version'];
                                        }
@@ -171,6 +173,7 @@ class SpecialVersion extends SpecialPage {
                                        $out .= $this->formatCredits(
                                                isset ( $extension['name'] )           ? $extension['name']        : '',
                                                $version,
+                                               $subVersion,
                                                isset ( $extension['author'] )         ? $extension['author']      : '',
                                                isset ( $extension['url'] )            ? $extension['url']         : null,
                                                isset ( $extension['description'] )    ? $extension['description'] : '',
@@ -217,9 +220,10 @@ class SpecialVersion extends SpecialPage {
                }
        }
 
-       function formatCredits( $name, $version = null, $author = null, $url = null, $description = null, $descriptionMsg = null ) {
+       function formatCredits( $name, $version = null, $subVersion = null, $author = null, $url = null, $description = null, $descriptionMsg = null ) {
                $extension = isset( $url ) ? "[$url $name]" : $name;
-               $version = isset( $version ) ? "(" . wfMsg( 'version-version' ) . " $version)" : '';
+               $version = isset( $version ) ? "(" . wfMsg( 'version-version' ) . " $version)" : '';            
+               $subVersion = isset( $subVersion ) ? "(" . wfMsg( 'version-revision' ) . " r$subVersion)" : '';
 
                # Look for a localized description
                if( isset( $descriptionMsg ) ) {
@@ -230,7 +234,7 @@ class SpecialVersion extends SpecialPage {
                }
 
                return "<tr>
-                               <td><em>$extension $version</em></td>
+                               <td><em>$extension $version $subVersion</em></td>
                                <td>$description</td>
                                <td>" . $this->listToText( (array)$author ) . "</td>
                        </tr>\n";
@@ -337,7 +341,7 @@ class SpecialVersion extends SpecialPage {
         * @param string $dir
         * @return mixed revision number as int, or false if not a SVN checkout
         */
-       public static function getSvnRevision( $dir ) {
+       public static function getSvnRevision( $dir , $extension = false) {
                // http://svnbook.red-bean.com/nightly/en/svn.developer.insidewc.html
                $entries = $dir . '/.svn/entries';
 
@@ -372,8 +376,13 @@ class SpecialVersion extends SpecialPage {
                        }
                        return false;
                } else {
-                       // subversion is release 1.4
-                       return intval( $content[3] );
+                       // subversion is release 1.4 or above
+                       if ($extension)
+                               // get the last file revsion number
+                               return intval( $content[10]) ;
+                       else
+                               // get the directory revsion number
+                               return intval( $content[3] );
                }
        }
 
index 0a8094a..ab257da 100644 (file)
@@ -3834,6 +3834,7 @@ You can also [[Special:Watchlist/edit|use the standard editor]].',
 'version-hook-name'                => 'Hook name',
 'version-hook-subscribedby'        => 'Subscribed by',
 'version-version'                  => 'Version',
+'version-revision'                 => 'Revision',
 'version-license'                  => 'License',
 'version-software'                 => 'Installed software',
 'version-software-product'         => 'Product',
index 7905ae6..01daf90 100644 (file)
@@ -2431,6 +2431,7 @@ $1',
 'version-hook-name'                => '鈎名',
 'version-hook-subscribedby'        => '用於',
 'version-version'                  => '版',
+'version-revision'                 => '訂',
 'version-license'                  => '牌',
 'version-software'                 => '裝件',
 'version-software-product'         => '品',
index 60132e5..08f379c 100644 (file)
@@ -2975,6 +2975,7 @@ $1',
 'version-hook-name'                => '鈎名',
 'version-hook-subscribedby'        => '利用於',
 'version-version'                  => '版本',
+'version-revision'                 => '修訂',
 'version-license'                  => '牌照',
 'version-software'                 => '裝咗嘅軟件',
 'version-software-product'         => '產品',
index 23f076a..c4d2152 100644 (file)
@@ -3026,6 +3026,7 @@ $1',
 'version-hook-name'                => '钩名',
 'version-hook-subscribedby'        => '署名',
 'version-version'                  => '版本',
+'version-revision'                 => '修订',
 'version-license'                  => '授权',
 'version-software'                 => '已安装软件',
 'version-software-product'         => '产品',
index 6700dec..067c5f0 100644 (file)
@@ -3002,6 +3002,7 @@ $1',
 'version-hook-name'                => '鈎名',
 'version-hook-subscribedby'        => '利用於',
 'version-version'                  => '版本',
+'version-revision'                 => '修訂',
 'version-license'                  => '授權',
 'version-software'                 => '已經安裝的軟件',
 'version-software-product'         => '產品',
index 63e2b7a..878aa8c 100644 (file)
@@ -2913,6 +2913,7 @@ $wgMessageStructure = array(
                'version-hook-name',
                'version-hook-subscribedby',
                'version-version',
+               'version-revision',
                'version-license',
                'version-software',
                'version-software-product',